---
---

<!DOCTYPE html>
<html lang=en>

<head>
  <meta charset=utf-8>

  <link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/common/css/stylesheet.css"/>
  <link rel="stylesheet" href="{{ site.baseurl }}/common/css/stylesheet-fonts.css" type="text/css" charset="utf-8">
  <link rel="icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
  <link rel="shortcut icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
  <title>Installing and Verifying Magento Community Edition (CE) and Enterprise Edition (EE)</title>

</head>

<body>
<a name="top"></a>

<img src="{{ site.baseurl }}/common/images/m1x/m1xheader.png" width="1024" alt="header" />

<div id="content">


<!-- title: Installing and Verifying Magento Community Edition (CE) and Enterprise Edition (EE) -->
<!-- URL: ce18-and-ee113-installing -->

<h1>Installing and Verifying Magento Community Edition (CE) and Enterprise Edition (EE)</h1>
<p><a href="{{ site.m1xgithuburl }}guides/m1x/install/installing_install.html" target="_blank">Edit this page on GitHub <img src="{{ site.baseurl }}/common/images/github_icon.png" height="15px"></a></p>


<div class="toc"> <h4 class="toc">Contents</h4>
<ul>
<li><a href="#overview">概述</a></li>
<li><a href="#prereq">先决条件</a></li>
<li><a href="#prepare">Preparing Your Server for Magento CE or EE</a></li>
<li><a href="#install-magento">Installing Magento CE or EE</a></li>
<li><a href="#verify">Verifying that Magento CE or Magento EE Installed Successfully</a></li>
<li><a href="#install-cron">Setting Up Cronjobs</a></li>
<li><a href="#install-privs-after">Setting Magento File System Permissions and Ownership After Installation</a></li>
<li><a href="#install-troubleshoot">故障排除</a></li>
</ul></div>

<h2 id="overview">概述</h2>
<p>This article discusses how to install:</p>
<ul><li>Magento Community Edition (CE) 1.8.x or 1.9.x</li>
<li>Magento Enterprise Edition (EE) 1.13.x or 1.14.x</li></ul>
<p>To install Magento CE or Magento EE, use the following high-level guidelines:</p>
<ol><li>Set up a system that meets the <a href="{{ site.m1xgdeurl }}system-requirements.html" target="_blank">Magento系统要求</a>.</li>
<li>Install prerequisite software (web server, PHP, and required PHP extensions).</li>
<li>Set up a MySQL Magento database instance.</li>
<li>Run the Magento installer to complete the installation.</li>
<li>Verify that Magento installed correctly.</li></ol>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-important.png" alt="important" align="left" width="40"><span><strong>Important</strong>: Perform <em>all installations</em> to Magento the latest version of CE 1.9 or Magento EE 1.14 to get the latest fixes, features, and security updates.</span></div>


<h2 id="prereq">先决条件</h2>
<p>Before starting your installation:</p>
<ul><li>Get the Magento installation archive as discussed in <a href="{{ site.m1xgdeurl }}install/installing.html#get" target="_blank">Getting Magento CE or EE</a>.</li>
<li>Set up one or more hosts that meet the <a href="{{ site.m1xgdeurl }}system-requirements.html" target="_blank">Magento系统要求</a>.</li>
<li>If you are setting up more than one web node with load balancing, set up and test that part of your system <em>before</em> you install Magento.</li>
<li>If your database server and web server are located on different hosts, <a href="{{ site.m1xgdeurl }}install/installing.html#help" target="_blank">get help</a> before proceeding.</li>
<li>Make sure you can back up your entire system at various points during the installation so you can roll back in the event of issues.</li></ul>
<p>Magento <em>strongly</em> recommends you observe the following guidelines when you set up your Magento database:</p>
<ul>
<li>Magento for the first time uses <a href="http://dev.mysql.com/doc/refman/5.0/en/triggers.html" target="_blank">MySQL database triggers</a> to improve database access during reindexing. Magento does not support any custom triggers in the Magento database because custom triggers can introduce incompatibilities with future Magento versions.</li>
<li>Familiarize yourself with <a href="http://dev.mysql.com/doc/mysql-reslimits-excerpt/5.1/en/stored-program-restrictions.html" target="_blank">these potential MySQL trigger limitations</a> before you continue.</li>
<li>If you use MySQL database replication, be aware that Magento <em>does not</em> support MySQL statement-based replication. Make sure you use only <a href="http://dev.mysql.com/doc/refman/5.1/en/replication-formats.html" target="_blank">row-based replication</a>.</li></ul>
<p>More information, including software prerequisites, can be found in the next section.</p>

<h2 id="prepare">Preparing Your Server for Magento CE or EE</h2>
<p>The following sections discuss how to download and install prerequisite software and install Magento CE or EE on a system running:</p>
<ul>
<li>Ubuntu 10或更新, or CentOS 6</li>
<li>Apache 2.x</li>
<li>nginx 1.7.x</li>
<li>PHP 5.4 and required extensions</li>
<li>MySQL database</li></ul>
<strong>Notes</strong>:
<ul><li>Discussing how to configure Secure Sockets Layer (SSL) is beyond the scope of this guide. You can consult some general resources such as <a href="http://httpd.apache.org/docs/2.4/ssl/" target="_blank">Apache</a>, <a href="http://www.zytrax.com/tech/survival/ssl.html" target="_blank">zytrax.com</a>, or the <a href="https://www.openssl.org/docs" target="_blank">OpenSSL documentation page</a>.</li>
<li>Discussing how to <a href="http://wiki.nginx.org/Install" target="_blank">install and configure nginx</a> is beyond the scope of this article.</li>
<li>Review the MySQL developer site's recommendations for <a href="http://dev.mysql.com/doc/refman/5.0/en/password-security-user.html" target="_blank">MySQL password security</a>.</li>
<li>Before you continue, make sure the system on which you install Magento meets the <a href="{{ site.m1xgdeurl }}system-requirements.html" target="_blank">Magento系统要求</a>.</li></ul>
<p>Complete the tasks discussed in the following sections in the order shown:</p>
<ol><li>Installing and configuring required prerequisite Software for <a href="{{ site.m1xgdeurl }}install/installing_req-prereq_ubuntu.html" target="_blank">Ubuntu</a>或<a href="{{ site.m1xgdeurl }}install/installing_req-prereq_centos.html" target="_blank">CentOS</a></li>
<li><a href="#install-prereq-selinux">SELinux Prerequisite</a></li>
<li><a href="#install-iptables">开户防火墙端口</a></li>
<li><a href="#install-optional">Installing 可选软件</a></li>
<li><a href="#install-create-db">Creating a Magento Database Instance</a></li>
<li><a href="#install-extract-archive">Extracting the Magento Installation Archive</a></li>
<li><a href="#install-sample">Installing Optional Sample Data</a></li></ol>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: Unless otherwise noted, all tasks discussed in this article must be performed by a user with <code>root</code> privileges.</div>


<h3 id="install-prereq-selinux">SELinux Prerequisite</h3>
<p><a href="http://selinuxproject.org/page/Main_Page" target="_blank">Linux增强安全(SELinux)</a> enables CentOS and Ubuntu administrators greater access control over their servers. If you're using SELinux <em>and</em> Apache must initiate a connection to another host, you must run the commands discussed in this section.</p>
<p>If Apache and the database server are on the same host, you can skip this section and continue with <a href="#install-iptables">开户防火墙端口</a>.</p>
<p>To enable Apache to initiate a connection to another host with SELinux enabled:</p>
<ol><li>To determine if SELinux is enabled, use the following command:
<pre>getenforce</pre>
<code>Enforcing</code> displays to confirm that SELinux is running.</li>
<li>Enter one of the following commands:
<ul><li>CentOS
<pre>setsebool -P httpd_can_network_connect=1</pre></li>
<li>Ubuntu
<pre>setsebool -P apache2_can_network_connect=1</pre></li>
</ul>
</li></ol>

<h3 id="install-iptables">开户防火墙端口</h3>
<p>Depending on your security requirements, you might find it necessary to open port 80 and other ports in your firewall. Because of the sensitive nature of networking security, Magento strongly recommends you consult with your IT department before proceeding. Following are some suggested references:</p>
<ul><li>Ubuntu: <a href="https://help.ubuntu.com/community/IptablesHowTo" target="_blank">Ubuntu documentation page</a>.</li>
<li>CentOS: <a href="http://wiki.centos.org/HowTos/Network/IPTables" target="_blank">CentOS how-to</a>和<a href="http://www.centos.org/docs/4/4.5/Security_Guide/s1-firewall-ipt-basic.html" target="_blank">CentOS reference page</a>.</li></ul>

<h3 id="install-optional">Installing 可选软件</h3>
<p>This section discusses how to create or install the following:</p>
<ul><li>Install and configure Network Time Protocol (NTP) which enables you to synchronize the system clock with pool servers located around the world. NTP is particularly useful for synchronizing the clocks of multiple hosts.</li>
<li>Create a <a href="http://php.net/manual/en/function.phpinfo.php" target="_blank"><code>phpinfo.php</code></a> file</li>
<li>Install and configure the <code>phpmyadmin</code> database administration utility.</li></ul>
<p>These optional utilities might assist you with your installation; however, they are not required to install or use Magento.</p>
<p>To skip installing these utilities, go directly to <a href="#install-create-db">Creating a Magento Database Instance</a>.</p>
<p>See the following sections:</p>
<ul><li><a href="#install-optional-ntp">Installing and Configuring Network Time Protocol (NTP)</a></li>
<li><a href="#install-optional-phpinfo">Creating phpinfo.php</a></li>
<li><a href="#install-optional-phpmyadmin">Installing phpmyadmin</a></li></ul>

<h4 id="install-optional-ntp">Installing and Configuring Network Time Protocol (NTP)</h4>
<p><a href="http://www.ntp.org" target="_blank">NTP</a> enables servers to synchronize their system clocks using <a href="http://www.pool.ntp.org/en" target="_blank">globally available pool servers</a>. Magento recommends you use NTP servers you trust, whether they are dedicated hardware solutions your internal network or external, public servers.</p>
<p>If you are deploying Magento on multiple hosts, NTP is a simple way to guarantee their clocks are all synchronized, no matter what time zone the servers are in.</p>
<p>To install and configure NTP:</p>
<ol><li><em>CentOS only.</em>
<ol><li>Enter the following command to find the appropriate NTP software:
<code>yum search ntp</code></li>
<li>Select a package to install. 例如， <code>ntp.x86_64</code>.</li>
<li>Install the package.
<code>yum -y install ntp.x86_64</code></li></ol>
</li>
<li><em>Ubuntu only</em>. Enter the following command to install NTP:
<code>apt-get install ntp</code></li>
<li>Select the NTP pool servers you wish to use.<br />
Selecting pool servers is up to you. If you use NTP pool servers, ntp.org recommends you use <a href="http://www.pool.ntp.org/en" target="_blank">pool servers</a> that are close to your servers' time zone as discussed on the <a href="http://www.pool.ntp.org/en/use.html" target="_blank">NTP pool project help page</a>. If you have a private NTP server that is available to all hosts in your Magento deployment, you can use that server instead.</li>
<li>Open <code>/etc/ntp.conf</code> in a text editor.</li>
<li>Look for lines similar to the following:
<pre>server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org</pre></li>
<li>Replace those lines or add additional lines that specify your NTP pool server or other NTP servers. It's a good idea to specify more than one.<br />
An example of using three United States-based NTP servers follows:
<pre>server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org</pre></li>
<li>Save your changes to <code>/etc/ntp.conf</code> and exit the text editor.</li>
<li><em>CentOS only</em>. Enter the following command so that NTP starts when the server starts.<br />
<pre>chkconfig ntpd on</pre></li>
<li>Restart the service.
	<ul><li>CentOS
<pre>service ntpd restart</pre></li>
<li>Ubuntu
<pre>service ntp restart</pre></li>
</ul>
</li>
<li>Enter the <code>date</code> command to check the server's date.<br />
If the date is incorrect, make sure the NTP client port (typically, UDP 123) is open in your firewall. Try the <code>ntpdate <em>pool-server-host-name</em></code> command. If it fails, search for the error it returns.<br />
If all else fails, try restarting the server.</li></ol>

<h4 id="install-optional-phpinfo">Creating phpinfo.php</h4>
<p><a href="http://php.net/manual/en/function.phpinfo.php" target="_blank"><code>phpinfo.php</code></a> displays a large amount of information about PHP and its extensions. Add the following code anywhere in your web server's docroot:</p>
<pre>&lt;?php
// Show all information, defaults to INFO_ALL
phpinfo();</pre>
<p>For more information, see the <a href="http://php.net/manual/en/function.phpinfo.php" target="_blank">phpinfo manual page</a>.</p>
<p>To view the results, enter the following URL in your browser's location or address field:
<pre>http://<em>web-server-ip-or-host</em>/phpinfo.php</pre>
<p>If a 404 (Not Found) error displays, check the following:</p>
<ul><li>Start the web server if necessary.</li>
<li>Make sure your firewall allows traffic on port 80.<br />
<a href="https://help.ubuntu.com/community/UFW" target="_blank">Help for Ubuntu</a><br />
<a href="http://wiki.centos.org/HowTos/Network/IPTables" target="_blank">Help for CentOS</a></li></ul>

<h4 id="install-optional-phpmyadmin">Installing phpmyadmin</h4>
<p><code>phpmyadmin</code> is an easy-to-use, free database administration utility. You can use it to check and manipulate the contents of your database. You must log in to <code>phpmyadmin</code> as the MySQL database administrative user.</p>
<p>For more information about <code>phpmyadmin</code>, see the <a href="http://www.phpmyadmin.net/home_page/index.php" target="_blank">phpmyadmin home page</a>.</p>
<p>For more detailed information about installation, see the <a href="http://docs.phpmyadmin.net/en/latest/setup.html#quick-install" target="_blank">phpmyadmin installation documentation</a>.</p>
<p>To install phpmyadmin on CentOS:</p>
<ol><li>Download the epel RPM for the version of CentOS you're using. A sample follows.
<pre>cd /tmp<br />
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm<br />
rpm -ivh epel-release-6-8.noarch.rpm</pre></li>
<li>Install <code>phpmyadmin</code> as follows:
<pre>yum -y install phpmyadmin</pre></li>
<li>Authorize access to phpmyadmin from your machine's IP address.
	<ol><li>Open the following file for editing:
<pre>vim /etc/httpd/conf.d/phpMyAdmin.conf</pre></li>
<li>Replace the following IP address with your IP address
<pre>#Require ip 127.0.0.1</pre>
例如，
<pre>Require ip 192.51.100.101</pre></li>
<li>Replace the following IP with your IP address
<pre>#Allow from 127.0.0.1</pre>
例如，
<pre>Allow from 192.51.100.101</pre></li>
</ol></li>
<li>Save your changes to <code>/etc/httpd/conf.d/phpMyAdmin.conf</code> and exit the text editor.</li>
<li>Restart Apache.
<pre>service httpd restart</pre></li>
<li>To use phpmyadmin, enter the following command in your browser's address or location field:<br />
<pre>http://<em>host-or-ip-address</em>/phpmyadmin</pre></li>
<li>When prompted, log in using your MySQL database <code>root</code> or administrative user's user name and password.</li></ol>
<p>To install phpmyadmin on Ubuntu:</p>
<ol><li>Use the following command:
<code>apt-get install phpmyadmin</code></li>
<li>Follow the prompts on your screen to complete the installation.</li>
<li>To use phpmyadmin, enter the following URL in your browser's address or location field:
<code>http://<em>host-or-ip-address</em>/phpmyadmin</code>
<li>When prompted, log in using your MySQL database <code>root</code> or administrative user's user name and password.</li></ol>

<h3 id="install-create-db">Creating a Magento Database Instance</h3>
<p>This section discusses how to create a new database instance for Magento. Although a new database instance is recommended, you can optionally install Magento into an existing database instance. If you choose to do that, skip this section and continue with <a href="#install-sample">Installing Optional Sample Data</a>.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: Before you continue, review the information about MySQL discussed in <a href="#prereq">先决条件</a>.</div>

<p>To create a new database instance:</p>
<ol><li>Log in to your database server as any user.</li>
<li>Enter the following commands in the order shown to create a database instance named <code>magento</code>:
<pre>mysql -u root -p
#Enter the remaining commands at the mysql> prompt.

create database magento;
GRANT ALL ON magento.* TO magento@localhost IDENTIFIED BY 'magento';</pre></li>
<li>For MySQL versions between 5.0.2 and 5.1.6, you must enter this command:
<pre>GRANT SUPER ON *.* TO 'magento'@'localhost';</pre></li>
<li>After you're done, enter <code>exit</code></li>
<li>Test the database instance.
<pre>mysql -u magento -p</pre>
Messages similar to the following display to confirm you successfully created the database instance. If errors display, repeat the preceding commands.
<pre>Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 20
Server version: 5.1.67 Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. translated by <a target="_blank" href="https://www.silksoftware.com">silksoftware co.ltd</a> - <a href="http://haiwera.xyz">Haiwera</a>

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.</pre></li></ol>

<h3 id="install-extract-archive">Extracting the Magento Installation Archive</h3>
<p>Extract the Magento installation archive on your web server's docroot.</p>
<p>The path on Ubuntu is typically <code>/var/www</code></p>
<p>The path on CentOS is typically <code>/var/www/html</code></p>
<p>Examples follow:</p>
<ul><li>Ubuntu
<pre>cd /var/www
cp /<em>path</em>/<em>magento-install-archive</em> .
tar -zxf <em>magento-install-archive-name</em></pre></li>
<li>CentOS
<pre>cd /var/www/html
cp /<em>path</em>/<em>magento-install-archive-name</em> .
tar -zxf <em>magento-install-archive</em></pre></li></ul>
<p>To optionally install Magento sample data, continue with the next section.</p>
<p>To install Magento without sample data, continue with <a href="#install-privs">Setting File and Directory Ownership and Privileges</a>.</p>

<h3 id="install-sample">Installing Optional Sample Data</h3>
<p>Magento provides sample data you can optionally install to give you an idea of what products look like in the Admin Panel and in your web store. You can use this sample data to learn how Magento works and to experiment with custom themes.</p>
<p>You must install sample data on the file system and in the database <em>before</em> you install Magento.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: <em>Only if your database is shared between more than one Magento installation</em>. Database table names used by the sample data are not configurable. To use sample data with a new Magento installation, you must manually add a prefix to all sample data tables and use the same prefix when you install Magento.</div>

<p>To skip sample data installation, continue with <a href="#install-privs">Setting File and Directory Ownership and Privileges</a>.</p>
<p>To install Magento sample data:</p>
<ol><li>Download the sample data from one of the locations discussed in <a href="{{ site.m1xgdeurl }}install/installing.html#get">Getting Magento CE or EE</a>.</li>
<li>If necessary, transfer the sample data to your Magento server.</li>
<li>On your Magento server, extract the sample data archive to a directory other than your Magento installation directory.</li>
<li>Make note of the path to the sample data's <code>media</code> subdirectory.</li>
<li>Change to the <code>[your Magento install dir]/media</code> directory.
<pre>#Ubuntu example
cd /var/www/magento/media

#CentOS example
cd /var/www/html/magento/media</pre></li>
<li>As a user with privileges to write to the Magento installation directories (typically the web server user), copy the sample data's <code>media</code> directory and subdirectories to your Magento installation directory.<br />
例如， to copy Magento sample data from <code>/home/username</code> to <code>/var/www/magento</code>, enter
<pre>cp -R /home/username/media/* .</pre></li>
<li><em>Magento CE 1.9 and Magento EE 1.14 only</em>. You must also copy the sample data's <code>skin</code> directory to <code>[your Magento install dir]/skin</code> as follows:<br />
例如， to copy Magento skin files from <code>/home/username/skin</code> to <code>/var/www/magento/skin</code>, enter
<pre>cd [your Magento install dir]/skin
cp -R /home/username/skin/* .</pre></li>
<li>Import the CE or EE sample data into your MySQL database as follows:
<pre>mysql -u root -p <em>magento-db-instance-name</em> &lt; <em>path-to-sample-data-extract-dir</em>/<em>sample-data-filename</em>.sql</pre>
EE 1.14 example
<pre>mysql -u root -p magento &lt; /home/username/magento_sample_data_for_1.14.0.0.sql</pre></li></ol>

<h3 id="install-privs">Setting File and Directory Ownership and Privileges</h3>
<p>Magento recommends the following ownership and privilege settings for files and directories in the Magento installation directory:</p>
<ul><li>The Magento installation directory and all subdirectories are owned by the web server user.<br />
This enables the web server to change files in these subdirectories but other users cannot access them (except a higher-level user such as <code>root</code>).</li>
<li>All directories have 700 permissions (<code>drwx------</code>).<br />
700 permissions give full control (that is, read/write/execute) to the owner and no permissions to anyone else.</li>
<li>All files have 600 permissions (<code>-rw-------</code>).<br />
600 permissions mean the owner can read and write but other users have no permissions.</li></ul>
<p><strong>注意</strong>: The way you set permissions and ownership depends on whether Magento is running on a dedicated or hosted system:</p>
<ul><li><em>Hosted</em>: A Magento server located on a hosting provider. A <em>hosted</em> system typically does not enable you to elevate to <code>root</code>. The web server typically runs as an ordinary user. Magento assumes you log in as this user to start and stop the web server and that you already own all the files and directories in the Magento installation directory. You can use <code>chmod</code> to change permissions on files and directories.</li>
<li><em>Dedicated</em>: A Magento server you control and operate. Unlike a hosted system, you can elevate to <code>root</code> and, as <code>root</code>, you can use the <code>chown</code>和<code>chmod</code> commands to set ownership and privileges in the Magento installation directory.</li></ul>
<p>To set privileges and ownership:</p>
<ol><li>Log in to your Magento server.</li>
<li>Change to your Magento installation directory:
<pre>#Ubuntu example
cd /var/www/magento

#CentOS example
cd /var/www/html/magento</pre></li>
<li><em>Dedicated Magento server only</em>. Enter the following command to set ownership of the Magento installation directory and all its subdirectories:
<pre>chown -R <em>web-server-user-name</em> .</pre>
例如， on Ubuntu where Apache usually runs as <code>www-data</code>, enter
<pre>chown -R www-data .</pre></li>
<li>Enter the following commands to set directory permissions to 700 and file permissions to 600:
<pre>find . -type d -exec chmod 700 {} \;
find . -type f -exec chmod 600 {} \;</pre></li></ol>
<!-- <li>Set file permissions.
<code>find . -type f -exec chmod 644 {} \;</code></li>
<li>Set directory permissions.
<code>find . -type d -exec chmod 755 {} \;</code></li>
<li>Make the <code>var</code>, <code>app/etc</code>,以及<code>media</code> directories and subdirectories world-writable.
<code>chmod -R 777 media app/etc var var/.htaccess</code></li>
<li>Change to the directory above the Magento installation directory.<br />
<code>#Ubuntu example<br />
cd /var/www/<br />
<br />
#CentOS example<br />
cd /var/www/html</code></li>
<li>Set ownership.
<code>#If you're not sure, find the web server group<br />
ps -o "user group command" -C httpd,apache2<br />
<br />
#Set ownership<br />
chown -R <em>your-user-name</em>:<em>web-server-group</em> magento<br />
<br />
#Ubuntu example<br />
chown -R myuser:www-data magento</code></li>
</ol> -->

<h2 id="install-magento">Installing Magento CE or EE</h2>
<p>This section discusses how to run the Magento installer, using Magento EE as an example. The Magento CE installer has exactly the same options; only the appearance is different.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-important.png" alt="important" align="left" width="40"><span><strong>Important</strong>: The procedure that follows assumes that your web server and database server are on the same host. If they are installed on different hosts, additional tasks are required. <a href="{{ site.m1xgdeurl }}install/installing.html#help" target="_blank">Get help</a> before you continue your installation.</span></div>

<p>To install Magento CE or EE:</p>
<ol><li>Complete all of the tasks discussed earlier in this article.</li>
<li>Enter the following URL in your web browser's address or location field:
<pre><em>web-server-ip-or-host</em>:<em>port</em>/<em>magento-path</em>/magento</pre>
例如， if your web server is <code>http://www.example.com</code>, listens on port 80, and Magento is installed in the web server docroot's <code>magento</code> subdirectory, enter
<pre>http://www.example.com/magento</pre>
The following page displays.<br >
<img src="{{ site.baseurl }}/common/images/m1x/install_first-page.png" height="353px" width="600px"></li>
<li>Select the check box that indicates you agree to the terms and conditions, and click <strong>Continue</strong>.</li>
<li>On the Localization page, enter the following information.<br />
<table>
<tbody>
<tr>
  <th>Option</th>
  <th>Meaning</th>
</tr>
<tr>
  <td>Locale</td>
  <td>From the list, click the option that best matches the locale in which your Magento server resides.</td>
</tr>
<tr>
  <td>时区</td>
  <td>From the list, click the option that best matches the time zone in which your Magento server resides.</td>
</tr>
<tr>
  <td>Default currency</td>
  <td>From the list, click the default currency to use on your Magento web store.</td>
</tr>
</tbody>
</table><br />
The following figure shows an example of configuring Magento for US English in the US Central time zone and using the US Dollar as the default currency.<br />
<img src="{{ site.baseurl }}/common/images/m1x/install_localization.png" height="307px" width="600px"></li>
<li>Click <strong>Continue</strong>.<br />
The Configuration page displays. Each of its three sections is discussed in the following step.</li>
<li>In the Configuration page, enter the following information:
<ol><li>In the Database Configuration section, enter the following information.<br />
<table>
<tbody>
<tr>
  <th>Option</th>
  <th>Meaning</th>
</tr>
<tr>
  <td>Database Type</td>
  <td>From the list, click <strong>MySQL</strong>.</td>
</tr>
<tr>
  <td>Host</td>
  <td>Enter the database server's fully qualified host name or IP address. Use the default setting of <strong>localhost</strong>如果你的数据库服务器和你的web服务器在一台主机上.</td>
</tr>
<tr>
  <td>Database Name</td>
  <td>Enter the 你想要把Magento数据表放入的数据库的名称</td>
</tr>
<tr>
  <td>User Name</td>
  <td>Enter the Magento数据库的所有者的用户名</td>
</tr>
<tr>
  <td>User Password</td>
  <td>Enter the Magento database owner's password.</td>
</tr>
<tr>
  <td>Tables Prefix</td>
  <td><p><em>(Optional.)</em> 仅用于安装数据库表到一个已经有Magento表的数据库时 In that case, enter a prefix to identify the Magento tables for this installation.</p>
  <p>Some customers have more than one Magento instance running on a server with all tables in the same database. 这个选项允许客户为多个Magento安装共享数据库服务器</p>
  </td>
</tr>
</tbody>
</table><br />
A sample follows.<br />
<img src="{{ site.baseurl }}/common/images/m1x/install_configuration_database.png" height="274px" width="600px"></li>
<li>In the Web Access Options section, enter the following information.<br />
<table>
<tbody>
<tr>
  <th>Option</th>
  <th>Meaning</th>
</tr>
<tr>
  <td>Base URL</td>
  <td>Enter the base URL to use to access the Magento Admin Panel and your Magento web store.</td>
</tr>
<tr>
  <td>Admin Path</td>
  <td>Enter the path to access the Admin Panel. This path is appended to <strong>Base URL</strong>.<br />
  例如， if <strong>Base URL</strong> is <code>http://www.example.com</code>和<strong>Admin Path</strong> is <code>admin</code>, the Admin Panel's URL is <code>http://www.example.com/admin</code>&mdash;provided you configured your web server for server rewrites.</td>
</tr>
<tr>
  <td>Enable Charts</td>
  <td>Select the check box to display charts on the Admin Panel.</td>
</tr>
<tr>
  <td>Skip Base URL Validation Before the Next Step</td>
  <td>Clearing this check box validates your server's base URL by performing an HTTP GET. Clear this check box unless your web server's base URL is not verifiable; for example, in a development or test environment.</td>
</tr>
<tr>
  <td>Use Web Server (Apache) Rewrites</td>
  <td>Select this check box to enable the use of the Apache <a href="http://httpd.apache.org/docs/2.2/rewrite/" target="_blank"><code>mod_rewrite</code></a> module. You can select this check box only if you configured Apache to use server rewrites.</td>
</tr>
<tr>
  <td>Use Secure URLs (SSL)</td>
  <td>Select this check box only if your web server supports SSL.</td>
</tr>
</tbody>
</table><br />
A sample follows.<br />
<img src="{{ site.baseurl }}/common/images/m1x/install_web-access-options.png" height="344px" width="600px"></li>
<li>In the Session Storage Options section, click one of the following options:
<ul><li><strong>File</strong> to store user session data on the file system in the <code>[your Magento install dir]/var/session</code> directory.<br />
File-based session storage is appropriate unless the Magento file system access is slow or you have a clustered database.</li>
<li><strong>数据库</strong> to store user session data in the database.<br />
如果你有一个数据库集群你可以选择数据库存储，否则，并不会比用文件来存储有更多好处</li>
<!-- <li>Other options might display, depending on how you set up session sharing. Click one of these options only if you're sure how they work.</li> --></ul>
</li>
</li>
<li>Click <strong>Continue</strong>.<br />
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-important.png" alt="important" align="left" width="40"><span><strong>Important</strong>: If errors display, you must resolve them before continuing.</span></div></li>
<li>In the Create Admin Account page, enter the following information.
<table>
<tbody>
<tr>
  <th>Option</th>
  <th>Meaning</th>
</tr>
<tr>
  <td>姓氏</td>
  <td>Enter the first name of the user you want to identify as the Magento web store owner.</td>
</tr>
<tr>
  <td>名字</td>
  <td>Enter the user's last name.</td>
</tr>
<tr>
  <td>Email</td>
  <td>Enter the user's email address.</td>
</tr>
<tr>
  <td>Username</td>
  <td>Enter the Magento Admin Panel administrator's user name. (You can create additional Magento administrators later.)</td>
</tr>
<tr>
  <td>Password</td>
  <td>Enter the user's password.</td>
</tr>
<tr>
  <td>Confirm Password</td>
  <td>Enter the user's password again for verification.</td>
</tr>
<tr>
  <td>Encryption Key</td>
  <td>If you have one, enter a key to encrypt sensitive data in the Magento database. If you don't have one, Magento generates one for you.<br />
  The encryption key is stored in <code>[your Magento install dir]/app/etc/local.xml</code>.</td>
</tr>
</tbody>
</table><br />
A sample follows.<br />
<img src="{{ site.baseurl }}/common/images/m1x/install_create-admin-account.png" height="511px" width="600px"></li>
<li>Click <strong>Continue</strong>.<br />
The following page displays to indicate a successful installation.<br />
<img src="{{ site.baseurl }}/common/images/m1x/install_confirm_mock.png" height="308px" width="600px"></li>
</li></ol></ol>

<h2 id="verify">Verifying that Magento CE or Magento EE Installed Successfully</h2>
<p>To make sure Magento installed properly, you should log in to the Admin Panel to verify the Magento version.</p>
<p>You can also import products into Magento or perform other tasks that verify you can write to the database.</p>
<ol><li>In a web browser's location or address field, enter the URL to the Admin Panel. An example follows:
<pre>http://www.example.com/magento/admin</pre>
(The Admin Panel URL is a combination of the <strong>Base URL</strong>和<strong>Admin Path</strong> fields you entered when you installed Magento.</li>
<li>Log in to the Admin Panel as an administrator.</li>
<li>Scroll to the bottom of the page; the version should display as 1.14 (Magento EE) or 1.9.0.0 (Magento CE).<br />
The following figure shows an example.<br />
<img src="{{ site.baseurl }}/common/images/m1x/install_verify-version_mock.png" height="36px" width="600px"></li></ol>
<!-- <li>Create a simple product.
<ol><li>In the Admin Panel, click <strong>Catalog</strong> > <strong>Manage Products</strong>.</li>
<li>In the upper right corner, click <strong>Add Product</strong>.</li>
<li>On the Create Product Settings page, accept the defaults and click <strong>Continue</strong>.</li>
<li>On the General page, enter the following information.
<table>
<tbody>
<tr>
  <th>Option</th>
  <th>What to enter</th>
</tr>
<tr>
  <td>Name</td>
  <td>Enter <code>Sample product</code>.</td>
</tr>
<tr>
  <td>SKU</td>
  <td>Enter <code>1234</code>.</td>
</tr>
<tr>
  <td>Weight</td>
  <td>Enter <code>1</code>.</td>
</tr>
<tr>
  <td>状态</td>
  <td>Click <strong>Enabled</strong>.</td>
</tr>
<tr>
  <td>Tax Class</td>
  <td>Click <strong>Taxable Goods</strong>.</td>
</tr>
<tr>
  <td>Visibility</td>
  <td>Click <strong>Catalog, Search</strong>.</td>
</tr>
</tbody>
</table></li>
<li>In the upper right corner, click <strong>Save and Continue Edit</strong>.</li>
<li>In the Prices page, in the <strong>Price</strong> field, enter <code>1</code>.</li>
<li>In the upper right corner, click <strong>Save and Continue Edit</strong>.</li>
<li>In the Description page, enter the required information.</li>
<li>In the upper right corner, click <strong>Save</strong>.</li></ol>
</li>
<li>Verify the product saved successfully without errors.</li>-->
<p>Congratulations! You successfully installed Magento!</p>

<h2 id="install-cron">Setting Up Cronjobs</h2>
<p>Several Magento features require at least one cronjob, which schedules activities to occur in the future. A partial list of these activities follows:</p>
<ul><li>Catalog price rules</li>
<li>Newsletters</li>
<li>Generating Google sitemaps</li>
<li>Customer Alerts/Notifications (product price change, product back in stock)</li>
<li>Reindexing <em>(Magento EE 1.13 only)</em></li>
<li>Private sales <em>(Magento EE only)</em></li>
<li>Automatic updating of currency rates</li>
<li><em>Magento EE 1.14.1 and later, Magento CE 1.9.1 and later</em> All Magento e-mails (including order confirmation and transactional)</li>
</ul>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: Magento depends on proper cronjob configuration for many important system functions, including indexing. Failure to set it up properly means Magento won't function as expected.</div>

<p>Crontab files define tasks (cronjobs) that are performed at scheduled dates and times. Each user on a system has its own crontab file, and the cron daemon runs each cronjob as the user who owns the crontab. For Magento, this user is the web server.</p>

<h3>Recommendations for cronjobs</h3>
<p>Magento recommends splitting your cronjob on two tasks in your crontab for best performance and completing your cronjobs without issues:</p>
<ul><li>Indexer Cronjob (<code>malways</code> mode) can take longer to execute and complete, skipping other cronjobs (<code>mdefault</code> mode) scheduled during the time that the indexer runs.</li>
  <li>Cronjobs in <code>mdefault</code> scope may take longer to execute and complete, blocking others scheduled during the time it is still running.</li>
</ul>

<p>To split your <code>malways</code>和<code>mdefault</code> cronjob modes, use the following:</p>
<pre>* * * * * /path/to/magento/cron.sh cron.php -mdefault
* * * * * /path/to/magento/cron.sh cron.php -malways</pre>

<p>Determine which of your cronjobs may be long-running and move them into separate crontabs. 例如， imports, exports, and indexes can run long, blocking other cronjobs scheduled in that crontab.</p>

<p>Magento recommends running cron every minute for EE and every five minutes for CE.</p>

<h3>Create cronjobs</h3>
<p>First, determine your web server's user. SSH into the server and enter the following command:
<pre>ps -o "user group command" -C httpd,apache2</pre>
<p>In CentOS, the Apache user is typically <code>apache</code>. In Ubuntu, it's typically <code>www-data</code>. Enter this user in the commands for creating the crontabs and cronjobs.</p>

<p>We recommend splitting the cronjob between two tasks to prevent the indexer blocking other <code>mdefault</code> jobs or an <code>mdefault</code> job blocking the indexer. These instructions include these commands.</p>

<p>To create a cronjob as the user that runs Apache:</p>
<ol>
<li>Create or edit a crontab for the Apache user. This command opens a vim text editor with the username of the Apache user. You might need to choose a text editor first.<br />
<pre>crontab -u <em>apache-user-name</em> -e</pre></li>
<li>To split cronjobs for better performance, enter the following:
<pre>* * * * * /bin/sh /path/to/magento/cron.sh cron.php -mdefault
* * * * * /bin/sh /path/to/magento/cron.sh cron.php -malways</pre><br>
例如， for CentOS,<br />
<pre>* * * * * /bin/sh /var/www/html/magento/cron.sh cron.php -mdefault
* * * * * /bin/sh /var/www/html/magento/cron.sh cron.php -malways</pre></li>
<li>If you do not want to split the cronjob, enter the following:
<pre>* * * * * /bin/sh /path/to/magento/cron.sh</pre><br>
例如， for CentOS,<br />
<pre>* * * * * /bin/sh /var/www/html/magento/cron.sh</pre></li>
<li>Save your changes to the crontab and exit the editor. For vim, press <code>:wp</code>.</li></ol>

<p>To check if crons are running, you should see the following log files in the Magento directory about 10 minutes after the scheduled cron runs:</p>
<pre>./cron.php.log
./cron.sh.log
</pre>

<h2 id="install-privs-after">Setting Magento File System Permissions and Ownership After Installation</h2>
<p>To secure your Magento installation after the installation, see <a href="{{ site.m1xgdeurl }}install/installer-privileges_after.html" target="_blank">After You 安装Magento: Recommended File System Ownership and Privileges</a>.</p>

<h2 id="install-troubleshoot">故障排除</h2>
<p>This section discusses some suggestions for issues you might encounter when installing Magento.</p>
<table>
<tbody>
<tr>
  <th>Issue</th>
  <th>Suggested solution</th>
</tr>
<tr>
  <td>During the installation, errors like the following display: <br />
  <code>Path "/var/www/html/magento/app/etc" must be writable.</code></td>
  <td>Set privileges and ownership on the Magento installation directory and subdirectories as discussed in <a href="#install-privs">Setting File and Directory Ownership and Privileges</a>.</td>
</tr>
<!-- <tr>
  <td>During the installation, errors like the following display: <br />
  <code>TBD - php extension.</code></td>
  <td>TBD</td> -->
</tr>
<tr>
  <td>You never advance past the installer's Configuration page.</td>
  <td>Try selecting the <strong>Skip Base URL Validation Before the Next Step</strong> check box. If problems persist, <a href="{{ site.m1xgdeurl }}install/installing.html#help" target="_blank">get help</a>.</td>
</tr>
</tbody>
</table>
